package com.xky.feigin.service;

import com.xky.feigin.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;


/**
 * @author keying.xia
 * @date 2017/12/15
 */
@Component
public class ServiceFallBackFactory implements FallbackFactory<Service>{

    @Override
    public Service create(Throwable throwable) {
        return new Service() {
            @Override
            public User findById(Long id) {
                User user = new User();
                user.setId(-1L);
                return user;
            }
        };
    }
}
